package com.qianji.service.impl;

import com.qianji.mapper.RecordMapper;
import com.qianji.pojo.ParticipationRecordDto;
import com.qianji.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 活动记录
 * @Author 钟丽诗
 * @Date 2021.4.1
 */
@Service
public class RecordServiceImpl implements RecordService {

    @Autowired
    private RecordMapper recordMapper;

    @Override
    public Integer addRecord(ParticipationRecordDto recordDto) {
        recordDto.setCreateTime(new Date());
        return recordMapper.addRecord(recordDto);
    }

    @Override
    public Long activityRecordCount(Long activityId) {
        return recordMapper.activityRecordCount(activityId);
    }
}
